namespace Crux.Core.Cache.Extensions;
/// <summary>
/// ILockProvider
/// </summary>
public interface ILockProvider
{
    /// <summary>
    /// 获取锁
    /// </summary>
    /// <param name="cacheKey"></param>
    /// <returns>是否成功</returns>
    bool LockTake(string cacheKey);
    /// <summary>
    /// 获取锁
    /// </summary>
    /// <param name="cacheKey"></param>
    /// <returns>是否成功</returns>
    Task<bool> LockTakeAsync(string cacheKey);
    /// <summary>
    /// 释放锁
    /// </summary>
    /// <param name="cacheKey"></param>
    /// <returns>是否释放了锁</returns>
    bool LockRelease(string cacheKey);
    /// <summary>
    /// 释放锁
    /// </summary>
    /// <param name="cacheKey"></param>
    /// <returns>是否释放了锁</returns>
    Task<bool> LockReleaseAsync(string cacheKey);
}